$def with (tData)
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>$session.webname</title>
<link rel="stylesheet" type="text/css" href="/static/css/site.css">
<link rel="stylesheet" type="text/css" href="/static/css/login.css">

</head>

<body>
<div class="main">
<div class="login">
	<form class="loginform" method="post" action="/login" onsubmit="return false;">
	<div class="rlogo">$session.webname</div>
	<div class="line"><input class="inputtxt" value="" name="username" datatype="*" nullmsg="请填写账号" errormsg="格式不对" placeholder="账号" type="text"><div class="Validform_checktip"></div></div>
	<div class="line"><input class="inputtxt" name="password" value="" datatype="*" nullmsg="请填写密码" errormsg="请填写密码" placeholder="密码" type="password"><div class="Validform_checktip"></div></div>
	<div style="color: red;position: relative;top: -14px;" id="errorStr"></div>
	<div class="line yzm" style="top: -5px; 
	$if session.code:
		display:block;
	$else:
		display:none;
	">
		<input type="text" class="inputtxt" name="code" nullmsg="请填写验证码" errormsg="验证码不对" datatype="*" placeholder="请填写验证码">
		<div class="Validform_checktip"></div>
		<img width="100" height="40" class="passcode" onClick="this.src=this.src.split('?')[0] + '?'+new Date().getTime()" src="/code" style="border: 1px solid #ccc; float: right;" title="点击换一张" >
	</div>
	<div class="login_btn"><input id="login-button" value="登录" type="submit"></div>
	<p class="pwinfo">3次以上登录错误将会出现验证码</p>
	<a class="resetpw" href="http://www.bt.cn/bbs/thread-1172-1-1.html" target="_blank">忘记密码>></a>
	</form>
</div>
</div>
<script type="text/javascript" src="/static/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/static/layer/layer.js"></script>
<script type="text/javascript" src="/static/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
	function Wreset(){
		var w = $$(window).width();
		var yzmw = $$(".login .line").width() - 140;
		if($$(".yzm").is(":visible") && w > 640){
			$$(".login").css({"height":"325px","margin-top":"-211px"})
		}
		else{
			$$(".login").removeAttr("style")
		}
		$$(".login .yzm .inputtxt").width(yzmw);
	}
	$$(function(){
		Wreset()
	})
	window.onresize=function(){
		Wreset()
	}
	</script>
	<script type="text/javascript">
	$$(function(){
		$$(".loginform").Validform({
			tiptype:function(msg,o,cssctl){
				if(!o.obj.is("form")){
					var objtip=o.obj.siblings(".Validform_checktip");
					cssctl(objtip,o.type);
					objtip.text(msg);
				}
			}
		});
	});
	
	$$('#login-button').click(function(){
		var username = encodeURIComponent($$("input[name='username']").val());
		var password = encodeURIComponent($$("input[name='password']").val());
		var code = $$("input[name='code']").val();
		if(username == '' || password == ''){
			layer.msg('表单错误,请重新输入!',{icon:2});
			return;
		}
		
		var data = 'username='+username+'&password='+password+'&code='+code;
		var loadT = layer.msg('正在登陆...',{icon:16,time:0,shade: [0.3, '#000']});
		$$.post('/login',data,function(rdata){
			layer.close(loadT);
			if(!rdata.status){
				$$("#errorStr").html(rdata.msg);
				$$("input[name='password']").val('');
				num = rdata.msg.substring(rdata.msg.indexOf('[')+1,rdata.msg.indexOf(']'))
				if(num < 5){
					$$(".yzm").show();
					$$(".login").css("height","332px");
					$$("input[name='code']").val('');
					$$(".passcode").click();
				}
				layer.msg(rdata.msg,{icon:2});
				return;
			}
			
			layer.msg(rdata.msg,{icon:16,time:0,shade: [0.3, '#000']});
			window.location.href = '/';	
		});
	});
	
</script>
</body>
</html>